<?php //pack11class

class MainAdminBlock extends Module {

    public $traceEnabled=true;

    public function setup() {

        $userin=SettingsManager::getSetting("userin");
        //trace($userin);
        if($userin->value) {
            $object=SettingsManager::getSetting("object");
            if(is_numeric($object->value)) {
                if($object->value==0) {
                    $this->addChild(new AdminObject);
                } else {
                    $this->addChild(new AdminObject($object->value));
                }
            } else {
                $setting=SettingsManager::getSetting("page");
                if($setting->value) {
                    $page=PagesManager::getPage($setting->value);
                    $className=$page->className;
                    $this->addChild(new $className);
                } else {
                    $this->addChild(new AdminObjectsList);
                }
            }
        } else {
            //$this->addChild(new Login);
        }
        
    }

}
?>
